Skip to content

Instantly share code, notes, and snippets.

@Mefistophell
Mefistophell / RUST.MD
Last active May 13, 2024 11:36
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
@ericbarch
ericbarch / chkraid.sh
Last active May 13, 2024 11:34
Dead simple alerts when your mdadm array degrades without setting up a full blown MTA
#!/bin/bash
# dead simple mdadm alerts via webhook
# by eric barch [v1.0 -- 2018.11.26]
# 1. place this file in ~/chkraid.sh
# chmod +x ~/chkraid.sh
# 2. drop this in your crontab:
@Verssae
Verssae / skip.js
Last active May 13, 2024 11:31
한양대학교 인권/폭력예방 교육시스템 스킵 스크립트
/**
[강의 영상 스킵]
1. 재생버튼을 눌러 한양대 로딩 영상이 끝나고(약 4초) 강의가 재생된 후 F12 버튼을 눌러 개발자 콘솔을 연 뒤 console 탭으로 이동한다.
2. 아래 스크립트를 붙여넣는다.
3. 사이트에서 나갈 것이냐고 묻는 창이 뜨면 '나가기'를 누른다.
4. 다시 영상이 로드되면 재생 버튼을 눌러 재생하고 영상 끝으로 컨트롤 버튼을 움직여 영상 시청을 완료한다.
**/
@rponte
rponte / sql_generator.sql
Created December 7, 2022 19:04
PostgreSQL: generating sample data
INSERT INTO proposal (
id, address, created_at, "document", email, "name", salary, status, updated_at
)
select
md5(random()::text || clock_timestamp()::text)::uuid as id
,'Rua das Tabajaras, ' || floor(random() * 9999)::int as address
,localtimestamp as created_at
,left(md5(random()::text), 16) as "document"
,left(md5(random()::text), 6) || '@zup.com.br' as email
,'Customer ' || left(md5(random()::text), 22) as "name"
@rponte
rponte / jaxws-enabled-logging.java
Created February 7, 2020 22:05
Enabling JAXWS request/response logging on console
/**
* Those parameters change depending on JAXWS implementation. In this case, I'm using
* Sun/Oracle implementation
*/
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");
@matthewpi
matthewpi / README.md
Last active May 13, 2024 11:25
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue

@vsigler
vsigler / _readme.md
Last active May 13, 2024 11:24 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@coldfire7
coldfire7 / Valorant Asia Pacific Servers & Ports
Last active May 13, 2024 11:23
Valorant Asia Pacific Servers & Ports
# Valorant Asia Pacific Servers
# Note most of the servers are AWS Global Accelerator anycast IP addresses
# https://aws.amazon.com/global-accelerator/features/#Static_anycast_IP_addresses
# https://en.wikipedia.org/wiki/Anycast
# Last Update: 2023-01-09
# ~CO7DFiRE
# All Asia Pacific Servers
13.248.193.101
13.248.197.71